<%@page contentType="text/html; charset=utf-8" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<html>
<head>
<title>페이지 생성</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="/simplewiki/js/prototype.js" type="text/javascript"></script>
<script src="/simplewiki/js/scriptaculous.js" type="text/javascript"></script>
<style type="text/css">
<!--
div.autocomplete_tags {
      position:absolute;
      width:250px;
      background-color:white;
      border:1px solid #888;
      margin:0px;
      padding:0px;
}
div.autocomplete_tags ul {
  list-style-type:none;
  margin:0px;
  padding:0px;
}
div.autocomplete_tags ul li.selected { background-color: #ffb;}
div.autocomplete_tags ul li {
  list-style-type:none;
  display:block;
  margin:0;
  padding:2px;
  height:32px;
  cursor:pointer;
}
-->
</style>
<script language="JavaScript">
function documentCreate() {
	frmdocument.submit();
}
</script>
</head>
<body bgcolor=#FFFFFF text=#000000 leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>
<table width="900" border="0" align="center">
	<tr>
		<td align=right>
		  <a href="javascript:documentCreate()"  title="Save">저장</a>
		  <a href="/simplewiki/view_page.do?id=${parentId}"  title="Cancel">취소</a>
		</td>
	</tr>	
	<tr>
		<td>
		  <!-- write Form  -->
		  <form:form commandName="document" name="frmdocument" action="/simplewiki/new_page.do" method="post">
		  	<input type="hidden" name="parentId" value="${parentId}" />
		  	<table border="0" cellpadding="0" cellspacing="1" width="100%" bgcolor="BBBBBB">
				  <tr>
					<td width="20%" align=center bgcolor="E6ECDE" height="22">제 목</td>
					<td width="80%" bgcolor=FFFFFF style="padding-left:10">
						<form:input path="title" cssStyle="width:100%"/>
					</td>
				  </tr>
				  <tr>
					<td bgcolor=FFFFFF style="padding-left:10" colspan="2">
						<form:textarea path="content" cssStyle="width:100%" rows="30"/>
					</td>
				  </tr>
				  <tr>
					<td align=center bgcolor="E6ECDE" height="22">Tags</td>
					<td bgcolor=FFFFFF style="padding-left:10">
						<form:input path="tags" cssStyle="width:100%"/>
						<span id="ac_indicator" style="display:none">NOW FETCHING...</span>
						<div id="autocomplete_tags" style="display:none;border:1px solid black;background-color:white;"></div>
						<script language="javascript">
							new Ajax.Autocompleter('tags', 'autocomplete_tags', '/simplewiki/autocomplete_tags.do', {tokens:',', indicator: 'ac_indicator'});
						</script>
					</td>
				  </tr>
			  </table>
		  </form:form>
		</td>
	</tr>  
</table>
</body>
</html>